v2 Plugin System: lambda-init, lambda-build, lambda-deploy#567
Conversation
…6 from CryptoSwift
|
Issue tracker #566 |
|
Could we add the ability to pass build options. Sometimes it is nice to optimize for size and we can use |
fcf0444 to
bf73943
Compare
Thank you @tkrajacic This is planned. This will be a default setting, with an opt-out possibility
I think UPDATE: It's difficult to get an authoritative list of compiler and linker flags passed with |
I was thinking more along the lines that you can pass arbitrary flags through to the compiler. Alternatively, why not just allow the user to add any |
I think we should provide both. 1/ a sensible default set of options (like |
# Conflicts: # Package@swift-6.0.swift # Sources/AWSLambdaPluginHelper/lambda-build/Builder.swift
eacfd04 to
1f90a3d
Compare
1f90a3d to
534cd29
Compare
…ility soto-core removed its platforms: declaration and now uses @available annotations on its types. Add matching availability annotations to generated clients, test functions, and update the generation script to include them automatically on future runs. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Uses SotoCore's .configFile(profile:) credential provider when --profile is specified, keeping the default credential chain otherwise. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This PR delivers the v4 plugin system, replacing the legacy single-purpose
archiveplugin with three focused SwiftPM command plugins that cover the end-to-end developer experience:lambda-init— Scaffold a new Lambda function from a templatelambda-build— Compile and package for Amazon Linux 2023 (via Docker or Apple container)lambda-deploy— Deploy to AWS Lambda (create, update, or delete)The legacy
archivecommand is preserved as a deprecated passthrough tolambda-build.Dependencies
Important
This PR depends on soto-project/soto-core#694 (fixes soto-project/soto-core#693) being merged and released.
Before merging this PR, the
Package.swiftdependency on soto-core must be reverted from the temporary branch on my fork (sebsto/soto-core, branchremove-platforms-use-availability-macro) back to the official repository:CI: API Breakage Check False Positives
Note
The CI "API breakage check" reports 33 false-positive "removed" types. This is a known SwiftPM bug (swiftlang/swift-package-manager#8081, #9254).
Root cause: The plugins depend on
AWSLambdaPluginHelperwhich depends on soto-core. soto-core and its transitive dependencies bring C targets (CSotoExpat,CNIOBoringSSL,CNIOBoringSSLShims) that get built for both.host(plugin) and.target(library) destinations. The API digester receives-Ipaths for both builds, triggering silent "redefinition of module" errors that prevent it from loadingAWSLambdaRuntime. All symbols then appear as "removed".The
AWSLambdaRuntimesource code is unchanged between this branch andmain. There are no actual API breakages. A partial fix landed in Swift 6.3.2 (PR #8776) for Swift targets, but Clang targets remain unfiltered. The full fix is tracked in PR #7664.Quick Start
Key Changes
Architecture
AWSLambdaPluginHelperexecutableInitializer,Builder, orDeployerbased onargv[1]Builder (
lambda-build)amazonlinux2toamazonlinux2023--cross-compileoption (replaces--container-cli):docker,container,swift-static-sdk,custom-sdk-Xlinker -sand--no-stripopt-out--output-directoryaccepted as deprecated alias for--output-pathDeployer (
lambda-deploy)AWSLambdaBasicExecutionRoleFunctionURLRequestusage in source code to enable URL without explicit--with-urlInitializer (
lambda-init)Sources/main.swiftandSources/<Name>/<Name>.swift)Dependencies
soto-corefor AWS credential management, SigV4 signing, and HTTP transportVendored/Backward Compatibility
swift package archivepreserved as deprecated alias (emits warning, delegates tolambda-build)--container-cliaccepted as deprecated alias for--cross-compile--output-directoryaccepted as deprecated alias for--output-patharchiveCLI options continue to workDocumentation
Known Limitations
LoginCredentialProvidercannot persist refreshed tokens in SwiftPM sandbox (workaround: tokens refresh in-memory, PR sent to soto-core (Make LoginCredentialProvider token persistence best-effort soto-project/soto-core#692))Testing
scripts/integration-test.sh)